# this file is used to execute as
# sh gen_stack_trace.sh $1 $2
# or
# ./gen_stack_trace.sh $1 $2

set -e

readeablestackfile=`dirname "$0"`
curdir=`dirname "$0"`
curdir=`cd "$curdir"; pwd`

# minidump_stackwalk is generated by breakpad
# $2: The path to the dmp file
# $1: The path to the sym file(in breakpad's format)
$(dirname $curdir)/installed/bin/minidump_stackwalk $2 $1 2>&1 > $readeablestackfile/dmp_stackwalk.txt

# de file's directory.
echo "readeable stack in " "$readeablestackfile/dmp_stackwalk.txt"
